<template>
    <div class="newAirSecurity">
        <Header :text="text"/>
        <Aside/>
        <main>
            <router-view/>
        </main>
    </div>
</template>

<script>
	import Header from "../components/Header"
	import Aside from "../components/Aside"

	export default {
		name: "NewAirSecurity",
		components: {
			Aside, Header
		},
		data() {
			return {
				text: ''
			}
		},
		watch: {
			$route(to) {
				if (to.path === '/newAirSecurity/flyer') {
					this.text = '飞手管理'
				} else {
					this.text = '设备管理'
				}
			}
		},
		created() {
			const path = this.$route.path
			if (path === '/newAirSecurity' || path === '/newAirSecurity/flyer') {
				this.text = '飞手管理'
			} else {
				this.text = '设备管理'
			}
		}
	}
</script>

<style scoped lang="scss">
</style>